package com.jsmile.cloud.msgcenter.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum HasReadEnum {

    READ(1, "已读"), NO_READ(0, "未读"),;

    /**
     * 值
     */
    private int value;
    private String name;

    /**
     * 根据value获取 名称
     */
    public static HasReadEnum nameOf(int value) {
        HasReadEnum type = null;
        for (HasReadEnum rt : HasReadEnum.values()) {
            if (rt.getValue() == value) {
                type = rt;
                break;
            }
        }
        return type;
    }

}
